import { APPFN_SET_VALUE_MAP } from '@/utils/tools';

// 合同类型
export enum ContractTypeEnum {
  mainContract = 1, // 1：主合同 2：crc协议 3：补充协议 4;其他协议
  crc = 2,
  add = 3,
  other = 4,
}
export const CONTRACT_TYPES = [
  {
    value: ContractTypeEnum.mainContract,
    label: '主合同',
  },
  {
    value: ContractTypeEnum.crc,
    label: 'CRC协议',
  },
  {
    value: ContractTypeEnum.add,
    label: '补充协议',
  },
  // {
  //   value: ContractTypeEnum.other,
  //   label: '其它协议'
  // }
];
export const CONTRACT_TYPES_MAP = APPFN_SET_VALUE_MAP(CONTRACT_TYPES);

// 适用合同类型
export enum ApplicationTypeEnum {
  mainContract = 0, // 0：主合同、补充协议
  crc = 1,
}
export const APPLICATION_TYPE = [
  {
    value: ApplicationTypeEnum.mainContract,
    label: '主合同、补充协议',
  },
  {
    value: ApplicationTypeEnum.crc,
    label: 'CRC协议',
  },
];
export const APPLICATION_TYPE_MAP = APPFN_SET_VALUE_MAP(APPLICATION_TYPE);

// 合同停/启用状态
enum ContractStopEnableStatusEnum {
  ENABLE = '1', // 启用
  STOP = '0', // 停用
}

export const CONTRACT_STOP_ENABLE_STATUS = [
  {
    value: ContractStopEnableStatusEnum.ENABLE,
    label: '启用',
  },
  {
    value: ContractStopEnableStatusEnum.STOP,
    label: '停用',
  },
];

// 合同审批状态
enum ContractExamineApproveStatusEnum {
  UN_SUBMIT = 2, // 待提交
  APPROVED = 3, // 审批中
  SEND_BACK = 4, // 已退回
  FINISHED = 5, // 已完成
  REJECTED = 6, // 已拒绝
}

export const CONTRACT_EXAMINE_APPROVE_STATUS_ENUM = [
  {
    value: ContractExamineApproveStatusEnum.UN_SUBMIT,
    label: '待提交',
    color: 'processing',
  },
  {
    value: ContractExamineApproveStatusEnum.APPROVED,
    label: '审批中',
    color: 'warning',
  },
  {
    value: ContractExamineApproveStatusEnum.SEND_BACK,
    label: '已退回',
    color: 'error',
  },
  {
    value: ContractExamineApproveStatusEnum.FINISHED,
    label: '已完成',
    color: 'success',
  },
  {
    value: ContractExamineApproveStatusEnum.REJECTED,
    label: '已拒绝',
    color: 'error',
  },
];

export const CONTRACT_EXAMINE_APPROVE_STATUS_ENUM_MAP = APPFN_SET_VALUE_MAP(
  CONTRACT_EXAMINE_APPROVE_STATUS_ENUM
);

// 日期查询类型
enum DateQueryTypeEnum {
  FIRST_SUBMIT = 1, // 首次提交日期
  SIGN_COMPLETE = 2, // 签署完成日期
  PAPER_CONTRACT_RECEIVE = 3, // 纸质合同接收日期
}

export const DATE_QUERY_TYPE_ENUM = [
  {
    value: DateQueryTypeEnum.FIRST_SUBMIT,
    label: '首次提交日期',
  },
  {
    value: DateQueryTypeEnum.SIGN_COMPLETE,
    label: '签署完成日期',
  },
  {
    value: DateQueryTypeEnum.PAPER_CONTRACT_RECEIVE,
    label: '纸质合同接收日期',
  },
];

// 经费支出/调整状态
enum FundsStatus {
  UN_SUBMIT = 2, // 待提交
  APPROVED = 3, // 审批中
  RETURNED = 4, // 已退回
  FINISHED = 5, // 已完成
  REJECTED = 6, // 已拒绝
  VOIDED = 8, // 已作废
}

export const FUNDS_STATUS = [
  {
    value: FundsStatus.UN_SUBMIT,
    label: '待提交',
    color: 'processing',
  },
  {
    value: FundsStatus.APPROVED,
    label: '审批中',
    color: 'warning',
  },
  {
    value: FundsStatus.RETURNED,
    label: '已退回',
    color: 'error',
  },
  {
    value: FundsStatus.REJECTED,
    label: '已拒绝',
    color: 'error',
  },
  {
    value: FundsStatus.VOIDED,
    label: '已作废',
    color: 'error',
  },
  {
    value: FundsStatus.FINISHED,
    label: '已完成',
    color: 'success',
  },
];

export const FUNDS_STATUS_MAP = APPFN_SET_VALUE_MAP(FUNDS_STATUS);

//付款登记筛选日期
export const PAY_DATE_QUERY_TYPE = [
  {
    value: 1,
    label: '付款日期',
  },
  {
    value: 2,
    label: '开票日期',
  },
  {
    value: 3,
    label: '领票日期',
  },
];
//付款登记状态
enum PAY_APPROVE_STATUS_ENUM {
  UN_SUBMIT = 2, // 草稿
  APPROVED = 3, // 审批中
  SEND_BACK = 4, // 已退回
  FINISHED = 5, // 已入账
}

export const PAY_STATUS = [
  {
    value: PAY_APPROVE_STATUS_ENUM.UN_SUBMIT,
    label: '待提交',
    color: 'processing',
  },
  {
    value: PAY_APPROVE_STATUS_ENUM.APPROVED,
    label: '审批中',
    color: 'warning',
  },
  {
    value: PAY_APPROVE_STATUS_ENUM.SEND_BACK,
    label: '已退回',
    color: 'error',
  },
  {
    value: PAY_APPROVE_STATUS_ENUM.FINISHED,
    label: '已入账',
    color: 'success',
  },
];
export const PAY_STATUS_MAP = APPFN_SET_VALUE_MAP(PAY_STATUS);

// 开票状态
export const OPEN_TICKET_STATUS = [
  {
    value: 0,
    label: '未开票',
  },
  {
    value: 1,
    label: '已开票',
  },
];

// 领票状态
export const GET_TICKET_STATUS = [
  {
    value: 0,
    label: '未领票',
  },
  {
    value: 1,
    label: '已领票',
  },
];

//经费支出状态
enum FUND_EXPEND_STATUS_ENUM {
  UN_SUBMIT = 2, // 待提交
  APPROVED = 3, // 审批中
  SEND_BACK = 4, // 已退回
  FINISHED = 5, // 已完成
  REFUSED = 6, // 已拒绝
  NULLIFY = 8, // 已作废
}

export const FUND_EXPEND_STATUS = [
  {
    value: FUND_EXPEND_STATUS_ENUM.UN_SUBMIT,
    label: '待提交',
    color: 'processing',
  },
  {
    value: FUND_EXPEND_STATUS_ENUM.APPROVED,
    label: '审批中',
    color: 'warning',
  },
  {
    value: FUND_EXPEND_STATUS_ENUM.SEND_BACK,
    label: '已退回',
    color: 'error',
  },
  {
    value: FUND_EXPEND_STATUS_ENUM.REFUSED,
    label: '已拒绝',
    color: 'error',
  },
  {
    value: FUND_EXPEND_STATUS_ENUM.NULLIFY,
    label: '已作废',
    color: 'error',
  },
  {
    value: FUND_EXPEND_STATUS_ENUM.FINISHED,
    label: '已完成',
    color: 'success',
  },
];
export const FUND_EXPEND_STATUS_MAP = APPFN_SET_VALUE_MAP(FUND_EXPEND_STATUS);

enum FUND_DETAILS_STATUS_ENUM {
  UNSETTLE = 0, // 未结算
  SETTLED = 1, // 已结算
}

export const FUND_DETAILS_STATUS = [
  {
    value: FUND_DETAILS_STATUS_ENUM.UNSETTLE,
    label: '未结算',
    color: 'processing',
  },
  {
    value: FUND_DETAILS_STATUS_ENUM.SETTLED,
    label: '已结算',
    color: 'success',
  },
];

export const FUND_DETAILS_STATUS_MAP = APPFN_SET_VALUE_MAP(FUND_DETAILS_STATUS);
